/************************************************************************************************
 * test examples of 100 interesting program in C
 * test 069.c
 * trick of magician (1)
 ***********************************************************************************************/

#include <stdio.h>

/*
 *
 */

int main()
{
	int a[13];
	int i = 0;
	for (i = 0; i < 13; i++)
		a[i] = 0;

	int curr = 0;
	for (i = 1; i <= 13; i++)
	{
		int n = 0;
		do
		{
			if (a[curr] == 0)
			{
				n++;
				if (n == i)
					a[curr] = i;
			}				
			curr++;
			curr %= 13;
		} while (n < i);
	}

	for (i = 0; i < 13; i++)
		printf("%3d", a[i]);
	printf("\n");
}

